<template>
  <div id="app">
    <router-view/>
  </div>
</template>

<script>
export default {
  name: "App",
  watch: {
    $route(to, from) {
      console.log("to" + to.name);
      console.log("from" + from.name);

      if (to.path != "/login") {
        let obj = {
          name: to.name,
          title: to.meta.title,
        };

        this.$store.commit("addTab", obj);
      }
    },
  },
};
</script>

<style>
#app {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
</style>
